#!/bin/sh

sensor_dir="/proc/jz/sensor"
params="name chip_id i2c_addr width height min_fps max_fps version"

[ -d "$sensor_dir" ] || { echo "$sensor_dir does not exist."; exit 1; }

case "$1" in
	all | -a)
		for i in $params; do
			printf '%-10s ' "$i:"
			[ -e "$sensor_dir/$i" ] && cat "$sensor_dir/$i" || echo "Error: $i not found."
		done
		;;
	*)
		[ -n "$1" ] && [ -e "$sensor_dir/$1" ] && cat "$sensor_dir/$1" || echo "Usage: $0 [${params} all]"
		;;
esac
